﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="uc_forgot_pass.ascx.cs" Inherits="main_uc_forgot_pass" %>
<%@ Register Assembly="ESWebFramework.I18N" Namespace="ESWebFramework.I18N" TagPrefix="eswf" %>
<script>
    $(document).ready(function() {
    $("#ctl00_ContentPlaceHolder1_uc_forgot_pass1_ESi18nButton1").click(Validate);
    });
    function Validate() {
        var returnVal = true;
        $("#main_center input[validate='true']").each(function(val, i) {
            if ($("#" + i.id).val() == "") {
                returnVal = false;
                $("#span" + i.id).remove();
                $("#" + i.id).after("<span id='span" + i.id + "' style='color:red;margin-left:2px;font-weight:bold'>*</span>");
                $("#" + i.id).css('border-style', 'solid 1px');
                $("#" + i.id).css('border-color', 'red');
                $("#" + i.id).blur(function() {
                    if ($(this).val() != "") {
                        $("#" + i.id).css('border-style', 'solid 1px');
                        $("#" + i.id).css('border-color', 'black');
                    }
                });
            }
        });
        returnVal = validateEmail($("#ctl00_ContentPlaceHolder1_uc_forgot_pass1_tb_email").val());
        return returnVal;
    }
    function validateEmail(email) {
        var returnVal = true;
        var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
        if (reg.test(email) == false) {
            $("#spanstep11_tbEmail").remove();
            $("#ctl00_ContentPlaceHolder1_uc_forgot_pass1_tb_email").after("<span id='spanstep11_tbEmail' style='color:red;margin-left:2px;font-weight:bold;font-size:10px'>invalid email format</span>");
            $("#ctl00_ContentPlaceHolder1_uc_forgot_pass1_tb_email").css('border-style', 'solid 1px');
            $("#ctl00_ContentPlaceHolder1_uc_forgot_pass1_tb_email").css('border-color', 'red');
            returnVal = false;
        }
        return returnVal;
    }
</script>
<div id="main_center">
    <div class="main_top" style="text-transform:uppercase">
        <eswf:ESi18nLabel ID="ESi18nLabel1" TextReference="f_pass" CssClass="_bold" runat="server"></eswf:ESi18nLabel>
    </div>
    <div class="main_content" style="height:100px">
        <div style="width:95%;height:100%;text-align:left">
        <div id="contact_admin" style="padding:5px">
            <asp:PlaceHolder ID="ContentPlaceHolder1" runat="server"></asp:PlaceHolder>
            <div class="contact_about">
                <eswf:ESi18nLabel ID="ESi18nLabel2" TextReference="f_pass_text" CssClass="_bold" runat="server"></eswf:ESi18nLabel>
            </div>
            <div class="contact_form_label">
                <eswf:ESi18nLabel ID="ESi18nLabel4" TextReference="email" runat="server"></eswf:ESi18nLabel>
            </div>
            <div class="contact_form_item">
                <asp:TextBox ID="tb_email" runat="server"></asp:TextBox>
            </div>
            <div class="contact_form_label">
                
            </div>
            <div class="contact_form_item">
                <eswf:ESi18nButton ID="ESi18nButton1" CssClass="contact_submit" 
                    TextReference="submit" runat="server" onclick="ESi18nButton1_Click" />
            </div>
        </div>
        </div>
    </div>
    <div class="main_top" style="text-transform:uppercase;font-size:14px;">
    </div>
</div>